package com.nineclock.system.feign;

import com.nineclock.attendance.dto.DepartmentOrUserSimpleDTO;
import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("sys-service")
public interface SysOrganizationFeign {
    /**
     *  查询企业ID下的所有顶级部门ID
     * @return
     */
    @GetMapping("/organization/department/top")
    public Result<List<Long>> queryDepartmentIds();

    /**
     *  查询指定部门集合下员工的数量
     * @param departmentIds
     * @return
     */
    @GetMapping("/organization/departments/membernums")
    public Result<Integer> queryUserCountByDepartmentIds(@RequestParam("departmentIds") List<Long> departmentIds);

    /**
     *  查询员工或者部门数据列表
     * @param departmentId
     * @return
     */
    @GetMapping("/organization/simple")
    public Result<List<DepartmentOrUserSimpleDTO>> querySimpleDepartment(@RequestParam(value = "id",required = false) Long departmentId,
                                                                         @RequestParam(value = "includeMember",required = false) Integer includeMember);

    /**
     * 根据员工id获得部门从低到高级别的部门ID数组
     * @param
     * @return
     */
    @GetMapping("/department/allDepId/{companyUserId}")
    public Result<List<Long>> queryDepartmentsByUserId(@PathVariable("companyUserId") Long companyUserId);

    /**
     * 获取员工列表
     * @return
     */
    @GetMapping("/organization/members/simple")
    public Result<List<SysCompanyUserDTO>> queryAllCompanyUser();


    //根据企业id查询改企业所有员工
    @GetMapping("/companyUser/queryAllUserByCompanyId")
    public Result<List<SysCompanyUserDTO>> queryAllUserByCompanyId(
            @RequestParam(value = "companyId", required = false) Long companyId);


    //根据企业ID查询企业的主管理员信息
    @GetMapping("/companyUser/queryAdminByCompanyId")
    public Result<SysCompanyUserDTO> queryAdminByCompanyId(@RequestParam(value = "companyId", required = false)Long companyId);
}
